package svc

import (
	"gitee.com/shijun123456/rpcVotes/internal/config"
	"gitee.com/shijun123456/rpcVotes/models"
	"github.com/tal-tech/go-zero/core/stores/sqlx"
)

type ServiceContext struct {
	Config       config.Config
	XindaluModel models.VoteModelInter
}

func NewServiceContext(c config.Config) *ServiceContext {
	return &ServiceContext{
		Config:       c,
		XindaluModel: models.NewDefaultModelImpl(sqlx.NewMysql(c.DataSource), &c.Cache),
	}
}
